package mipushdemo.xiaomi.com.diyitonghang.ui.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import mipushdemo.xiaomi.com.diyitonghang.R;
import mipushdemo.xiaomi.com.diyitonghang.data.bean.HuaBean;

public class HuaRecyAdapter extends BaseQuickAdapter<HuaBean.DataBean.TopicListBean,BaseViewHolder> {
    public HuaRecyAdapter(int layoutResId, @Nullable List<HuaBean.DataBean.TopicListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HuaBean.DataBean.TopicListBean item) {
        helper.setText(R.id.home_item_title,item.getTitle());
        helper.setText(R.id.home_item_zhiDing,item.getNickname());
        helper.setText(R.id.home_item_origin,"看过:"+item.getPageviews());
        helper.setText(R.id.home_item_readCount,item.getPublishTime());
        Glide.with(mContext).load(item.getImageListThumb().get(0)).into((ImageView) helper.getView(R.id.home_item_img));
    }
}
